package com.example.shutdown;

import org.litepal.crud.DataSupport;

public class PowerPlan extends DataSupport {

	private boolean powerOnEnable;
	private boolean powerOffEnable;
	private int week;
	private int offHour;
	private int offMin;
	private int onHour;
	private int onMin;

	public PowerPlan() {
		super();
	}

	public PowerPlan(boolean powerOnEnable, boolean powerOffEnable, int week,
			int offHour, int offMin, int onHour, int onMin) {
		super();
		this.powerOnEnable = powerOnEnable;
		this.powerOffEnable = powerOffEnable;
		this.week = week;
		this.offHour = offHour;
		this.offMin = offMin;
		this.onHour = onHour;
		this.onMin = onMin;
	}

	public boolean isPowerOnEnable() {
		return powerOnEnable;
	}

	public void setPowerOnEnable(boolean powerOnEnable) {
		this.powerOnEnable = powerOnEnable;
	}

	public boolean isPowerOffEnable() {
		return powerOffEnable;
	}

	public void setPowerOffEnable(boolean powerOffEnable) {
		this.powerOffEnable = powerOffEnable;
	}

	public int getWeek() {
		return week;
	}

	public void setWeek(int week) {
		this.week = week;
	}

	public int getOffHour() {
		return offHour;
	}

	public void setOffHour(int offHour) {
		this.offHour = offHour;
	}

	public int getOffMin() {
		return offMin;
	}

	public void setOffMin(int offMin) {
		this.offMin = offMin;
	}

	public int getOnHour() {
		return onHour;
	}

	public void setOnHour(int onHour) {
		this.onHour = onHour;
	}

	public int getOnMin() {
		return onMin;
	}

	public void setOnMin(int onMin) {
		this.onMin = onMin;
	}

	@Override
	public String toString() {
		return "PowerPlan [powerOnEnable=" + powerOnEnable + ", powerOnTime="
				+ onHour + ":" + onMin + ", powerOffEnable=" + powerOffEnable
				+ ", powerOffTime=" + offHour + ":" + offMin + ", week="
				+ getWeekString(week) + "]";
	}

	private String getWeekString(int week) {
		switch (week) {
		case 1:
			return "Sunday";
		case 2:
			return "Monday";
		case 3:
			return "Tuesday";
		case 4:
			return "Wednesday";
		case 5:
			return "Thursday";
		case 6:
			return "Friday";
		case 7:
			return "Saturday";
		default:
			return "";
		}
	}

}